package com.yxkj.syh.app.huarong.activities.user.appointment;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.syh.app.basic.base.BaseActivity;
import com.yxkj.syh.app.huarong.BR;
import com.yxkj.syh.app.huarong.R;
import com.yxkj.syh.app.huarong.constants.ArouterPath;
import com.yxkj.syh.app.huarong.databinding.ActivityAppointmentBinding;

/**
 * 回头车预约 预约
 */
@Route(path = ArouterPath.APPOINTMENT_ACTIVITY)
public class AppointmentActivity extends BaseActivity<ActivityAppointmentBinding, AppointmentVM> {

    @Autowired
    long id;

    @Override
    protected int getContentLayout() {
        return R.layout.activity_appointment;
    }

    @Override
    protected int getViewModelId() {
        return BR.appointmentVM;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        if (id == 0) finish();

        mVDBinding.titleView.setLeftOnClickListener(v -> finish());

        mVDBinding.btnUnAppointment.setOnClickListener(v -> {
            if (id > 0) {
                mViewModel.unAppointment(id);
            }
        });

    }

    @Override
    protected void initData() {
        mViewModel.apointmentInfo(id);
    }
}
